#include "verilated.h"
#include "verilated_vcd_c.h"
#include "obj_dir/Vv_rams_8.h"

VerilatedContext* contextp = NULL;
VerilatedVcdC* tfp = NULL;

static Vv_rams_8* top;

void step_and_dump_wave(){
  top->eval();
  contextp->timeInc(1);
  tfp->dump(contextp->time());
}
void sim_init(){
  contextp = new VerilatedContext;
  tfp = new VerilatedVcdC;
  top = new Vv_rams_8;
  contextp->traceEverOn(true);
  top->trace(tfp, 0);
  tfp->open("dump.vcd");
}

void sim_exit(){
  step_and_dump_wave();
  tfp->close();
}

int main() {
  sim_init();
 top->inaddr=0b011;
 top->outaddr=0b011;
 top->din=0x2a;
 top->we = 1;
  top->clk = 0;step_and_dump_wave();
 top->clk = 1; step_and_dump_wave();
 top->we=0;
  top->clk = 0;step_and_dump_wave();
 top->clk = 1; step_and_dump_wave();


  sim_exit();
}
